Getting Started
Introduction VariableTriggers is a plugin for the CraftBukkit Server. With it you can create triggers that respond to in game events and actions by adding one or more lines of text to a trigger. These lines of text are called script lines and are run when the trigger they are attached to is activated. For instance if we had a walk trigger set on a certain block, then when a player walks over that block the trigger is activated and all the script lines attached to the trigger are exicuted(run). Installing Lets start off by talking about installing VariableTriggers on your server. CraftBukkit has a folder called /plugins/ All you need to do is copy the VariableTriggers.jar file to this folder and start your server. Everything else is done automatically for you. The config.yml file can be found in a folder call /plugins/VariableTrigger/ and in this file you can change some of the functionality. You can open your permissions file give yourself the vtrigger.admin permission node if you don't already have the node '*' or are an operator. Vault Hooking Vault is an optional feature. Vault is hooked for Economy & Permissions support. Permissions functionality will convert to superperms if Vault is not installed. Economy functionality will be disabled if Vault is not installed. All other functionality will work regardless. Permissions By default, operators have all vtrigger permissions while non-operators only have player permissions. See: Permission Nodes What are Triggers Triggers are the heart of this plugin, used for initializing events and having the ability to effect your server in a profound way. See: Triggers In-Game Commands These are the prompt commands that you type in. To create a Walk Trigger you would type /vtwalk along with a line of script. Script Commands These are the one line commands you add to a trigger. Place Holders Place holders are simply a way to place data values from the game in your script command. Functional Place Holders These are similar to Place Holders except they are replaced with the in game data at the moment they are interpeted, and some take arguments. Dynamic Object Variables Undoubtedly the most powerful part of this plugin. You can create your own Object Variables at any time in the game and name them anything you want to. Scripts Scripts are made up of one or more script commands. Making Your First Trigger Once you have familiarize yourself with the topics above we can show you how to create some triggers and then expand on that. You will need the want tool (default bone) for this. In the game lets type the following in the comand prompt: '/vtclick @PLAYER Hello you are in ' Hit Enter. You will be asked to right click a block with the wand(bone) to set or add to a trigger. Click a block, you should be told Trigger Created. Now click the block and a message is displayed to only the player that clicked the block. The place holders and will be automatically replaced with the player's name and the world name. Now type the following and hit Enter. /vtclick @POOF 3 You will be asked to Click a block to set the location, click the same block as before. You will see Location Set and be asked to click a block to set or add to a trigger. Click the same block again. We just added a second script line to the trigger. Now click it again and you will see the message but you will also see a poof of smoke from the trigger. The 3 in @POOF 3 is the volume of smoke. You can keep using /vtclick and add line after line to the trigger, but once you get the hang of it you will probably want to start writing some of your scripts first and save them in a separete file. Then you can @CALL the script from a trigger or from another script. To view the script on a trigger you can type /vtclickview or /vtwalkview you will be asked to click on a trigger to view it. For an event trigger you type /vteventview Lets make an event trigger. Type the following lines and hit enter after each. /vtevent Join @ADDINT $.joincount 1 /vtevent Join @IF i $.joincount = 1 /vtevent Join @BROADCAST Welcome This is the first time we have seen you. Have a sword. /vtevent Join @DROPITEM Iron_Sword 1 FireAspect:2 /vtevent Join @ELSE /vtevent Join @BROADCAST Welcome , you have joined $.joincount times /vtevent join @ENDIF You have just created your first Event Trigger. This is the Join event and whenever a player joins the server it will run whatever lines of script you have on it. To remove the Event trigger type: /vteventremove Join Using Area Triggers Area triggers are very useful and can be used in many ways. Lets go over the proccess of defining an area and setting its triggers. First we must define an area by seting two locations to define a cube. We do this /vt setarea command. This will let you use the wand(bone) to Left click for position 1 Right click for possition 2 Once we have set the two positions we type: /vt definearea MyFirstArea We have just defined an area named MyFirstArea. You may only use a name once per world for an area. Now type : /vtarea MyFirstArea Enter @PLAYER Welcome to We have just created our first Enter area trigger, lets add another script line to this trigger. Type: /vtarea MyFirstArea Enter @LIGHTNING false OK lets create an exit trigger on this area. Type: /vtarea MyFirstArea Exit @PLAYER Now leaving You now have an area with an enter and exit trigger. you may add as many lines of script as you want.